package cqie.frame.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 此表为菜单表，表明菜单的基本信息，如ID，名称，路径，图标等。
 * </p>
 *
 * @author HHL
 * @since 2021-09-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_menu")
@ApiModel(description = "菜单表")
public class SysMenu extends Model<SysMenu> {

    private static final long serialVersionUID = 1L;

    /**
     * 菜单ID
     */
    @TableId(value = "id",type = IdType.AUTO)
    @TableField(value = "id")
    @ApiModelProperty(value = "菜单ID")
    private Long id;
    /**
     * 菜单名称
     */
    @TableField(value = "name")
    @ApiModelProperty(value = "菜单名称")
    private String name;
    /**
     * 程序路径
     */
    @TableField(value = "appUrl")
    @ApiModelProperty(value = "菜单路径")
    private String appUrl;
    /**
     * 图标路径
     */
    @TableField(value = "imgUrl")
    @ApiModelProperty(value = "菜单路径")
    private String imgUrl;
    /**
     * 排序码
     */
    @TableField(value = "sortCode")
    @ApiModelProperty(value = "排序码")
    private Integer sortCode;
    /**
     * 上级菜单ID
     */
    @TableField(value = "parentId" , strategy = FieldStrategy.IGNORED)
    @ApiModelProperty(value = "父级菜单ID")
    private Long parentId;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
